package com.akaovi.chatroom.mess;

import java.io.Serializable;

/**
 * @author akaovi
 * @version 1.0
 * @description
 * @date 2022/12/7 16:30
 * @since 2022/12/7 16:30
 */
public class ResponseStatus extends Message implements Serializable {
    private static final long serialVersionUID = 7179685070435642351L;
    private int status;
    private String details;

    public ResponseStatus(MessType type, int status, String details) {
        this.type = type;
        this.status = status;
        this.details = details;
    }

    public static ResponseStatus ok(MessType type) {
        return new ResponseStatus(type, 200, Constant.OK);
    }

    public static ResponseStatus fail(MessType type) {
        return new ResponseStatus(type, 400, Constant.FAIL);
    }

    public static ResponseStatus fail(MessType type, String details) {
        return new ResponseStatus(type, 400, details);
    }

    public int getStatus() {
        return status;
    }

    public String getDetails() {
        return details;
    }
}
